<template lang="">
    <div>
        <div class="table-body-box">
            <div class="study-center-form">
                <el-form style="margin-left:60px;margin-top:25px;" :inline="true">
                    <el-form-item label="课程名称：">
                      <el-input
                        clearable
                        size="small"
                        placeholder="请输入内容"
                        v-model="title">
                      </el-input>
                    </el-form-item>
                    <el-form-item label="讲师：">
                      <el-input
                        clearable
                        size="small"
                        placeholder="请输入内容"
                        v-model="username">
                      </el-input>
                    </el-form-item>
                      <el-form-item style="margin-right:0;" label="课程类别">
                        <el-select size="small" v-model="courseDept" placeholder="请选择课程类别">
                            <el-option label="全部" value=""></el-option>
                            <el-option label="公司课程" value="1"></el-option>
                            <el-option label="部门课程" value="0"></el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
                <div class="btn-box">
                    <el-button type="primary" @click="searchList(1,10)" :loading="searchLoading" size="small">查询</el-button>
                </div>
            </div>
            <div class="study-center-table">
                <el-table 
                row-class-name="greyRow"
                height="70vh"
                :data="tableData" 
                style="width: 100%" 
                :header-cell-style="{background:'#4787E3',color:'#ffffff'}">
                  <el-table-column show-overflow-tooltip prop="title" label="课程名称" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="username" label="讲师" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="courseDept" :formatter="initCourseDept" label="课程类别" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="flag" :formatter="initData" label="是否公开" align="center">
                  </el-table-column>
                  <el-table-column show-overflow-tooltip prop="num" label="人数限制" align="center">
                  </el-table-column>
                  <el-table-column
                  align="center"
                  fixed="right"
                  label="操作" 
                  width="140">
                  <template slot-scope="scope">
                      <el-button style="text-decoration:underline;" type="text" @click="applyClick(scope.row)" size="small">审批</el-button>
                      <el-button style="text-decoration:underline;" type="text" @click="uploadPg(scope.row.id)" size="small">下载评估</el-button>
                  </template>
                  </el-table-column>
                </el-table>
                <div class="study-center-pagination flex-row">
                  <pagination 
                    @pageTurnNum="pageNum" 
                    @pageTurnSize="pageSizeNum" 
                    :total="total"></pagination>
                </div>
            </div>
        </div>
        <el-dialog
        title="查看申请"
        :visible.sync="checkApply"
        width="800px"
        :before-close="handleClose">
        <div class="class-detail-box">
            <div class="tips-box">
                <div style="font-size:16px;" class="class-tips">开课详细信息</div>
            </div>
            <div>
                <el-form 
                class="class-finish"
                style="text-align:center;"
                label-width='100px'
                :inline="true">
                    <el-form-item style="margin-bottom: 10px" label="课程名称：">
                        <el-input
                        style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="qryCourseByIdObj.title">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="课程说明：">
                       <el-input
                       style="width:193px;"
                       readonly
                        clearable
                        size="small"
                        v-model="qryCourseByIdObj.smallTitle">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="时长：">
                       <el-input
                        class="class-time-line"
                        style="width:160px;"
                        readonly
                        clearable
                        size="small"
                        v-model="qryCourseByIdObj.courseTime">
                        <div slot="append">min</div>
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="日期：">
                       <el-input
                       style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        placeholder="请输入内容"
                        v-model="qryCourseByIdObj.date">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="时间：">
                       <el-input
                       style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="qryCourseByIdObj.time">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="地点：">
                       <el-input
                       style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="qryCourseByIdObj.address">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="人数限制：">
                       <el-input
                        style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="qryCourseByIdObj.num">
                        </el-input>
                    </el-form-item>
                    <el-form-item style="margin-bottom: 10px" label="课程类别：">
                       <el-input
                        style="width:193px;"
                        readonly
                        clearable
                        size="small"
                        v-model="qryCourseByIdObj.courseDept">
                        </el-input>
                    </el-form-item>
                    <div style="text-align:left;padding-left:69px;">
                        <el-form-item label="是否公开：">
                            <el-switch style="width:193px;" disabled v-model="qryCourseByIdObj.isOpen"></el-switch>
                        </el-form-item>
                    </div>
                    <!-- <el-form-item  label="是否推荐：">
                        <el-switch style="width:193px;" disabled v-model="qryCourseByIdObj.isGood"></el-switch>
                    </el-form-item> -->
                    <div style="margin-top:20px;">
                        <el-form-item label="课程简介：" prop="desc">
                            <el-input resize='none' disabled style="width:525px;height:100px !important;" readonly type="textarea" v-model="qryCourseByIdObj.introduce"></el-input>
                        </el-form-item>
                    </div>
                </el-form>
            </div>
        </div>
        <div style="text-align:center;padding:36px 0 26px 0;">
          <span slot="footer"  class="dialog-footer">
              <el-button size="small" :loading="disagree"  @click="apply(0)">驳 回</el-button>
              <el-button size="small" :loading="agree" type="primary" @click="apply(1)">同 意</el-button>
          </span>
        </div>
        </el-dialog>

        <!-- 下载课程评估 -->
        <el-dialog
        title="提示"
        :visible.sync="downLoadPg"
        width="300px"
        center>
        <span>确定下载课程评估吗？</span>
        <span slot="footer"  class="dialog-footer">
            <el-button size="mini" :loading="agree" @click="downLoadPg = false">取 消</el-button>
            <el-button size="mini" :loading="agree" @click="downLoadPg = false" type="primary"><a style="color: #ffffff !important;" :href="downLoadHref" download="" target="_blank" >确 定</a></el-button>
        </span>
        </el-dialog>
    </div>
</template>
<script src="./studyjs/classFinsh"></script>
<style lang="less" scoped>
@import url("~@/pagecss/studyCenter");
@import url("~@/pagecss/classApply");
</style>